/*
 * DataReader.h
 *
 *  Created on: Nov 17, 2010
 *      Author: dblyth
 */

#ifndef DATAWRITER_H_
#define DATAWRITER_H_

#include <TFile.h>
#include <TTree.h>

class DataWriter {
public:
	DataWriter(int runNum);
	virtual ~DataWriter();

	void writeData(unsigned int** data, double* sum);

private:
	TFile** crate;
	TTree** tree;
	TBranch** dataBranch;
	TBranch** nFADCBranch;
	TBranch** pedestalBranch;
	TBranch** sumBranch;
	int data[9][20][16][48];
	int nFADC[9];
	int pedestal[9][20][16];
	double sum[9][20][16];
};

#endif /* DATAWRITER_H_ */
